﻿<UserControl 
    x:Class="Ccflow.Web.UI.Control.Workflow.Designer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"   
    xmlns:contentMenu="clr-namespace:Ccflow.Web.UI.Control.Workflow.Designer"
    xmlns:liquidTreeView="clr-namespace:Liquid;assembly=Liquid.TreeView"
    xmlns:liquidMenu="clr-namespace:Liquid;assembly=Liquid.Menu"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:local="clr-namespace:WF.Resources" 
    KeyDown="UserControl_KeyDown"
    KeyUp="UserControl_KeyUp"        
    xmlns:my="clr-namespace:WF.Controls" 
    xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" 
    Loaded="UserControl_Loaded"  MouseLeftButtonDown="UserControl_MouseLeftButtonDown" 
    MouseRightButtonDown="UserControl_MouseRightButtonDown" >
    <UserControl.Resources>
        <local:Text x:Name="TextRes"></local:Text>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" ShowGridLines="False" Margin="0" Background="white"  >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="225" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Grid.RowSpan="2" Background="white"  Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Name="stackPanelLeft"   Orientation="Vertical">
            <Image x:Name="imageLogo" Width="210" Height="70" Margin="5,2,5,2" Source="./Images/Logo/CCFlow/LogoW.jpg"   />
            <sdk:TabControl  Name="TbcFDS" Width="220" Height="auto"    MouseLeave="TbcFDS_MouseLeave" >
                <sdk:TabItem Header="{Binding TbItemFlow, Source={StaticResource TextRes}}" Name="TbItemFlow" Background="white" BorderThickness="0">
                    <Canvas Background="white" MouseLeftButtonDown="CvsFlowTree_MouseLeftButtonDown" Name="CvsFlowTree" Width="Auto" Height="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch" >
                        <liquidTreeView:Tree x:Name="TvwFlow"  BorderThickness="0" Width="210"  
                                             HorizontalScrollBarVisibility="Auto"
                                             VerticalScrollBarVisibility="Auto"   
                                             EnableLines="True"  
                                             SelectionChanged="TvwFlow_SelectionChanged" 
                                             MouseRightButtonDown="TvwFlow_MouseRightButtonDown" 
                                             MouseLeftButtonDown="TvwFlow_MouseLeftButtonDown" >
                        </liquidTreeView:Tree>
                        <liquidMenu:Menu x:Name="MuFlowTree" Background="white" Visibility="Collapsed" ItemSelected="MuFlowTree_ItemSelected">
                            <liquidMenu:MenuItem ID="OpenFlow" Text="打开流程"  Icon="../Images/MenuItem/Open.png" />
                            <liquidMenu:MenuItem ID="NewFlow_Blank" Text="新建/导入流程"  Icon="../Images/MenuItem/New.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="NewFlowSort" Text="新建流程类别" Icon="../Images/MenuItem/FlowSort.png"  />
                            <liquidMenu:MenuItem ID="Edit" Text="编辑流程类别"  Icon="../Images/MenuItem/Edit.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Delete" Text="删除" Icon="../Images/MenuItem/Delete.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Share" Text="共享" Icon="../Images/MenuItem/Share.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Refresh" Text="刷新" Icon="../Images/MenuItem/Refresh.png"  />
                        </liquidMenu:Menu>
                    </Canvas>
                </sdk:TabItem>
                <sdk:TabItem Header="表单库" Name="TbItemFrm" Background="white" BorderThickness="0">
                    <Canvas Background="white" 
                            MouseLeftButtonDown="CCFormTree_MouseLeftButtonDown" Name="canvasFormTree" 
                            Width="Auto" Height="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch" >
                        <liquidTreeView:Tree x:Name="FromTree"  BorderThickness="0" Width="210"  
                                             HorizontalScrollBarVisibility="Auto"
                                             VerticalScrollBarVisibility="Auto"
                                             EnableLines="True"   Height="900"
                                             SelectionChanged="CCForm_SelectionChanged" 
                                             MouseRightButtonDown="CCForm_MouseRightButtonDown" 
                                             MouseLeftButtonDown="CCForm_MouseLeftButtonDown" >
                        </liquidTreeView:Tree>
                        <liquidMenu:Menu x:Name="MuFormTree" Background="white" Visibility="Collapsed" ItemSelected="MuFrmTree_ItemSelected">
                            <liquidMenu:MenuItem ID="Frm_EditForm" Text="表单属性"  Icon="../Images/Form.png" />
                            <liquidMenu:MenuItem ID="Frm_NewForm" Text="新建表单"  Icon="../Images/FormNew.png" />


                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Frm_FormDesignerFix"  Text="设计傻瓜表单"   Icon="../Images/MenuItem/Edit.png"  />
                            <liquidMenu:MenuItem ID="Frm_FormDesignerFree" Text="设计自由表单"   Icon="../Images/MenuItem/Edit.png" />

                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Frm_Exp"  Text="导出"   Icon="../Images/MenuItem/Edit.png"  />
                            <liquidMenu:MenuItem ID="Frm_Imp" Text="导入"   Icon="../Images/MenuItem/Edit.png" />

                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Frm_NewFormSort" Text="新建表单类别" Icon="../Images/MenuItem/FlowSort.png"  />
                            <liquidMenu:MenuItem ID="Frm_EditSort" Text="编辑表单类别"  Icon="../Images/MenuItem/Edit.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Frm_Delete" Text="删除" Icon="../Images/MenuItem/Delete.png" />
                            <liquidMenu:MenuDivider />
                            <liquidMenu:MenuItem ID="Frm_Refresh" Text="刷新" Icon="../Images/MenuItem/Refresh.png"  />
                        </liquidMenu:Menu>
                    </Canvas>
                </sdk:TabItem>

                <sdk:TabItem Header="流程优化" Name="Tbwf" Background="white"  Visibility="Collapsed"  >
                    <liquidTreeView:Tree x:Name="TvwFlowDataEnum"  
                                             BorderThickness="0" Width="210"  
                                             HorizontalScrollBarVisibility="Auto"
                                             VerticalScrollBarVisibility="Auto"
                                             MouseRightButtonDown="TreeViewSysMenu_li_MouseRightButtonDown"
                                             EnableLines="True"    
                                             MouseLeftButtonDown="TreeViewSysMenu_li_MouseLeftButtonDown" >
                    </liquidTreeView:Tree>
                </sdk:TabItem>
                <sdk:TabItem Header="系统维护" Name="TbSystemMaintain" Background="white"   >
                    <liquidTreeView:Tree x:Name="TvwSysMenu"  BorderThickness="0" Width="210"  
                                             HorizontalScrollBarVisibility="Auto"
                                             VerticalScrollBarVisibility="Auto"   
                                             MouseRightButtonDown="TreeViewSysMenu_li_MouseRightButtonDown"
                                             EnableLines="True"    
                                             MouseLeftButtonDown="TreeViewSysMenu_li_MouseLeftButtonDown" >
                    </liquidTreeView:Tree>
                </sdk:TabItem>
            </sdk:TabControl>
        </StackPanel>

        <StackPanel Grid.Column="1"  Grid.Row="0" HorizontalAlignment="Left" Name="stackPanel2" VerticalAlignment="Bottom"  Orientation="Horizontal">
            <my:Toolbar x:Name="toolbar1">
            </my:Toolbar>
        </StackPanel>

        <my:TabControlEx Grid.Row="1" Grid.Column="1"   Width="Auto" Height="Auto"  x:Name="tbDesigner"
            TabStripPlacement="Top"  HorizontalAlignment="Left" VerticalAlignment="Top"  
            SelectionChanged="tbDesigner_SelectionChanged" >
            <my:TabControlEx.Background>
                <ImageBrush ImageSource="./Images/Logo/CCFlow/Welcome.jpg" Stretch="Fill"/>
            </my:TabControlEx.Background>

            <my:TabControlEx.Template>
                <ControlTemplate>
                    <!-- TabStripPlacement Top -->
                    <Grid x:Name="TemplateTop" Visibility="Collapsed" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Canvas.ZIndex="1">
                                <controlsPrimitives:TabPanel x:Name="TabPanelTop" Margin="2,2,2,-1">
                                </controlsPrimitives:TabPanel>
                            </StackPanel>
                            <StackPanel VerticalAlignment="Bottom">
                                <Button x:Name="btnShowList" HorizontalAlignment="Right" Content="/WF;component/Themes/img1.png" Height="20">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <Image Source="{TemplateBinding Content}" x:Name="btnImg"></Image>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Popup Width="auto" Height="auto" x:Name="HeadList" IsOpen="False">
                                </Popup>
                            </StackPanel>
                        </Grid>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Row="1" MinHeight="10" MinWidth="10" CornerRadius="0,0,3,3">
                            <ContentPresenter x:Name="ContentTop" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
                        </Border>
                        <Border x:Name="DisabledVisualTop" IsHitTestVisible="False" Opacity="0" Canvas.ZIndex="1" Background="#8CFFFFFF" Grid.RowSpan="2" CornerRadius="0,0,3,3" Grid.Row="1" />
                    </Grid>
                </ControlTemplate>
            </my:TabControlEx.Template>
        </my:TabControlEx>
    </Grid>
</UserControl>
